import React, { Component } from 'react';
import './Recomitem.css'

class RecomItem extends Component {
  constructor(props) {
    super(props)
  
    this.state = {
      list:[],
      paly:{}
    }
  }
  
  componentDidMount(){
    console.log(this.props.location.params.id);
    let id=this.props.location.params.id;
    this.$axios({
      url:"http://127.0.0.1:9115/playlist/detail?id="+id
    }).then(res=>{
      console.log(res);
      this.setState((state)=>{
        return {
          list:res.playlist.tracks,
          paly:res.playlist
        }
      })
      console.log(this.state.paly.coverImgUrl);
    })
  }
  render() {
    console.log(this.props.location)
    return (
      <div className="app">
        <div className="warp1">
          <div className="img1">
            <img mode="widthFix" src={this.state.paly.coverImgUrl}></img>
          </div>
        </div>
      </div>
    );
  }
}

export default RecomItem;